//---------------------------------------------------------------------------

#include "vcl_stl.h"
#pragma hdrstop

#include "h_base.h"
#include "h_xml.h"
#include "h_global.h"
using namespace h_base;
using namespace h_xml;

#include "h_designcontrol.h"
#include "t_mainform.h"
#include "h_i18n.h"

#include "t_transferprogressform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TTransferProgressForm *TransferProgressForm;
//---------------------------------------------------------------------------
__fastcall TTransferProgressForm::TTransferProgressForm(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TTransferProgressForm::Init(const UTF8String &IpAddr, int Port)
{
   char TmpStr[200 + 1];
   snprintf(TmpStr, 200, h_g::I18nString("t_transferprogressform:IP_ADDRESS_PORT"),
      IpAddr.c_str(), Port);
   PanelAddr->Caption = UTF8String(TmpStr);
   ProgressBar1->Position = 0;
}

void __fastcall TTransferProgressForm::Step(void)
{
   ProgressBar1->StepIt();
}

void __fastcall TTransferProgressForm::ButtonCancelClick(TObject *Sender)
{
   PostMessage(MainForm->Handle, HM_TRANSFERCANCELED, 0, 0);
}
//---------------------------------------------------------------------------
